package game.web.base;

import projectx.core.base.ProjectXMessage;
import projectx.core.common.element.Element;

public final class UserElement {

	// --------------------------------------------------------------------------
	// S T A T I C M E M B E R S
	//
	// --------------------------------------------------------------------------
	public static final int userIdLength = 80;
	public static final int userNameLength = 30;
	public static final int companyCodeLength = 2;
	public static final int employeeNoLength = 6;
	public static final int telNoLength = 20;
	public static final int memoLength = 40;

	// --------------------------------------------------------------------------
	// S T A T I C M E T H O D S
	//
	// --------------------------------------------------------------------------

	public static ProjectXMessage checkUserId(String name, String value) {

		return Element.checkMailAddress(name, value, userIdLength);
	}

	public static ProjectXMessage checkUserName(String name, String value) {

		return Element.checkMaxLength(name, value, userNameLength);
	}

	public static ProjectXMessage checkCompanyCode(String name, String value) {

		return Element.checkAsciiAlphaNumeric(name, value, companyCodeLength,
				true);
	}

	public static ProjectXMessage checkEmployeeNo(String name, String value) {

		return Element.checkAsciiAlphaNumeric(name, value, employeeNoLength,
				true);
	}

	public static ProjectXMessage checkTelNo(String name, String value) {

		return Element.checkTelNo(name, value, telNoLength);
	}

	public static ProjectXMessage checkMemo(String name, String value) {

		return Element.checkMaxLength(name, value, memoLength);
	}

	// --------------------------------------------------------------------------
	// C O N S T R U C T O R S
	//
	// --------------------------------------------------------------------------
	private UserElement() {
	}
}
